/*
Java source file
Copyright: Umschalt.com 2012
*/
package com.david.documentation.domain.dao.search;

import com.david.documentation.domain.AbstractDokusTest;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;

@Transactional
public class SearchDaoImplTest extends AbstractDokusTest {

	@Autowired
	private SearchDao searchDao;

	@Test
	public void testFindDokuNames() throws Exception {

		Long start,end;

		start = System.currentTimeMillis();
		System.out.print("SIZE: "+ searchDao.findDokusByNameAndDescription("deutsch",null,null).size());
		end = System.currentTimeMillis();
		System.out.println(" - INDEX TIME: " + (end-start));
		
		start = System.currentTimeMillis();
		System.out.print("SIZE: "+ searchDao.findDokuNamesAndDescriptionSql("deutsch").size());
		end = System.currentTimeMillis();
		System.out.println(" - SQL TIME: " + (end-start));

	}
}
